#ifndef __core_types_h__
#define __core_types_h__

#include <windows.h>

namespace core
{
    /*
     * @brief: define color
     */
    struct Color
    {
        union
        {
            unsigned long value;
            struct rgb
            {
                byte r;
                byte g;
                byte b;
                byte a;
            }rgb_value;
        };

        Color() : value(0) {}

        Color(unsigned long value) : value(value) {}

        operator unsigned long() { return value; }
    };

    /*
     * @brief: unit
     */
    struct Unit
    {
        int use;
        bool pixel;

        Unit() 
            : use(0)
            , pixel(true)
        {
        }

        int operator()(int length) const
        {
            if (!pixel)
            {
                return use * length / 100;
            }
            return use;
        }

        Unit & operator=(int u)
        {
            use = u;
            pixel = true;
            return *this;
        }
    };
}

#endif